package com.aidex.biz.service.impl;

import java.util.List;
import com.aidex.common.annotation.DataScope;
import com.github.pagehelper.PageInfo;
import com.aidex.common.core.domain.entity.SysUser;
import com.aidex.common.core.domain.entity.SysDept;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.framework.cache.DeptUtils;
import com.aidex.framework.cache.UserUtils;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.aidex.biz.mapper.ElectronFenceMapper;
import com.aidex.biz.domain.ElectronFence;
import com.aidex.biz.service.ElectronFenceService;
import org.springframework.transaction.annotation.Transactional;
import com.aidex.common.utils.NumberUtils;

/**
 * 回收员电子围栏Service业务层处理
 * @author sean
 * @email 2074844820@qq.com
 * @date 2022-09-28
 */
@Service
@Transactional(readOnly = true)
public class ElectronFenceServiceImpl extends BaseServiceImpl<ElectronFenceMapper, ElectronFence> implements ElectronFenceService
{
    private static final Logger log = LoggerFactory.getLogger(ElectronFenceServiceImpl.class);

    /**
     * 获取单条数据
     * @param electronFence 回收员电子围栏
     * @return 回收员电子围栏
     */
    @Override
    public ElectronFence get(ElectronFence electronFence)
    {
        ElectronFence dto = super.get(electronFence);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 回收员电子围栏id
     * @return 回收员电子围栏
     */
    @Override
    public ElectronFence get(String id)
    {
        ElectronFence dto = super.get(id);
        return dto;
    }


    /**
     * 查询回收员电子围栏列表
     * @param electronFence 回收员电子围栏
     * @return 回收员电子围栏
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public List<ElectronFence> findList(ElectronFence electronFence)
    {
        return super.findList(electronFence);
    }

    /**
     * 分页查询回收员电子围栏列表
     * @param electronFence 回收员电子围栏
     * @return 回收员电子围栏
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public PageInfo<ElectronFence> findPage(ElectronFence electronFence)
    {
        return super.findPage(electronFence);
    }

    /**
     * 保存回收员电子围栏
     * @param electronFence
     * @return 结果
     */
    @Override
    public boolean save(ElectronFence electronFence)
    {
        return super.save(electronFence);
    }


    /**
     * 删除回收员电子围栏信息
     * @param electronFence
     * @return 结果
     */
    @Override
    public boolean remove(ElectronFence electronFence)
    {
        return super.remove(electronFence);
    }

    /**
     * 批量删除回收员电子围栏
     * @param ids 需要删除的回收员电子围栏ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteElectronFenceByIds(String[] ids)
    {
        return mapper.deleteElectronFenceByIds(ids);
    }

    /**
     * 获取最大编号
     * @param electronFence 回收员电子围栏
     * @return 结果
     */
    @Override
    public int findMaxSort(ElectronFence electronFence)
    {
        return NumberUtils.nextOrder(mapper.findMaxSort(electronFence));
    }
}
